package demo1.dao.mapper;

import demo1.entity.User;
import org.springframework.jdbc.core.PreparedStatementSetter;
import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.lang.Nullable;

import java.sql.ResultSet;
import java.sql.SQLException;

public class UserMapper implements RowMapper<User> {
    @Nullable
    @Override
    public User mapRow(ResultSet rs, int i) throws SQLException {
        return new User(rs.getInt("id"),rs.getString("name"),rs.getString("pass"));
    }
}
